package cn.itcast.xuesheng.service.impl;


import cn.itcast.xuesheng.dao.UserDao;
import cn.itcast.xuesheng.dao.impl.UserDaoImpl;
import cn.itcast.xuesheng.domain.User;
import cn.itcast.xuesheng.service.UserService1;
import org.junit.runner.RunWith;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext.xml"})
public class UserServiceImpl implements UserService1 {

    ApplicationContext applicationContext=new ClassPathXmlApplicationContext("applicationContext.xml");
    UserDao userDao=null;
    public void setUserDao(UserDaoImpl userDao) {
    }
    @Override
    public User isLogin(User user) {
        return null;
    }

    @Override
    public void insert(User user) {
        System.out.println(applicationContext);
        userDao = (UserDao) applicationContext.getBean("userDao");
        System.out.println(userDao);
    }

    @Override
    public User check(String username) {
        return null;
    }

    @Override
    public void update(User user) {

    }

    @Override
    public void delete(String tid) {

    }

    @Override
    public void deleteSelect(String[] id) {

    }
}
